<?php if(!empty($subvo)){
    $v = $subvo;
    $subvo = '';
}
if(!empty($subsubvo)){
    $v = $subsubvo;
    $subsubvo = '';
}
?>

<div class="viewBox myBox<?php echo $v['id'];?>" <?php if($_SESSION[C('USER_AUTH_KEY')]){?> sortID="<?php echo $v['sort'];?>" modulesID="<?php echo $v['id'];?>" title="<?php echo $v['title'];?>" deleteUrl="<?php echo U('/Admin/Modules/delete',array('id'=>$v['id']));?>" settingUrl="<?php echo U('/Admin/Modules/edit',array('id'=>$v['id']));?>" isEdit="1" editUrl="<?php echo U('/Admin/Window/index',array('modules_id' => $v['id'], 'siteid' => __SITEID__, 'tablename'=>'Nav','fieldlist' => 'title,link,target,sort,icon,img_url','map'=>'modules_id,'.$v['id']));?>"<?php }?>>
   <?php if(!empty($v['dataname'])){
                $v['content'] = $v['dataname'];
                
        }else{
            $v['content'] = unserialize($v['content']);
        }
         ?>
 
  <div class="nav-glyphicons">
    <ul class="nav-glyphicons-list" style="background-color:#b2191b">
                  <li class="dropdown lastfirst"> <a href="##" style="line-height:45px; color:#fff; display:block;" class="dropdown-toggle dropdown<?php echo $v['id'];?> navon" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="fa fa-bars" aria-hidden="true"></span> <span class="glyphicon-class">所有商品分类 <i class="glyphicon glyphicon-triangle-bottom"></i></span></a> 
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  <div class="dorpdown dropdown-menu" id="categorys-2014">
      <div class="dd">
        <div class="dd-inner">
        
        
        <?php foreach($v['content'] as $key => $p):?>

          <div class="item fore<?php echo $key;?>">
            <h3><a href="__APP__/<?php echo $p['name'];?>" target="_blank"><?php echo $p['title'];?></a></h3>
            <span class="glyphicon glyphicon-menu-right"></span> </div> 

            
             <?php endforeach; ?>
        </div> 
        
        
        
        
        <div style="display: none;" class="dorpdown-layer" id="index_menus_sub">
          
          
          <?php foreach($v['content'] as $key => $p):?>
          <div class="item-sub row">
            <div class="col-sm-8">
                <ul>
                    <?php foreach(getCategories($p['id']) as $key => $c){?>
                        <li><a href="__APP__/<?php echo $c['name'];?>"><?php echo $c['title'];?></a>
                        
                        <ul>
                        <?php foreach($c['sub'] as $key => $s){?>
                            <li><a href="__APP__/<?php echo $s['name'];?>"><?php echo $s['title'];?></a></li>
                        <?php }?>
                        </ul>
                        </li>
                    <?php }  ?>
                </ul>
            </div>
            <div class="col-sm-4">

                   <div class="row">
                   
                   <?php foreach(getCategoriesBrands($p['id']) as $key => $b){?>
                   
                      <div class="col-xs-6 col-md-6 col-sm-6" style="padding:0; margin-left:-1px; height:48px;">
                        <a href="#" class="thumbnail">
                          <img src="<?php echo getThumbPath($b['img_url']);?>" alt="<?php echo $b['title'];?>">
                        </a>
                      </div>
                   <?php }?>
                    </div>
            </div>
            
            
          </div>  
          <?php endforeach; ?>
          
           
       
        </div>
        
        
      
        
        
      </div>
    </div>
                  
                  
                  
                  
                  
                  
                   </li>
             
    </ul>
    
    
    
    
  </div>
  
  
  
  <?php if(strtolower(GROUP_NAME) != 'admin'){?>
  <script>
      $(".dropdown<?php echo $v['id'];?>").on("click", function() {
		 var Swidth = $(window).width();
		 var Ewidth = $(this).width();
		 
		 
		 
		 
		 var Eleft = $(this).offset().left;
		 if(Ewidth + Eleft >= Swidth){
			 $(this).next('.dropdown-menu').addClass('dropdown-menu-right');
		 }
    });
	



            $(function() {

                $(".dd-inner").children(".item").hover(function() { //一级导航悬浮

                    $(this).addClass("hover").siblings(".item").removeClass("hover");

                    var index = $(this).index();

                    $(".dorpdown-layer").children(".item-sub").hide();

                    $(".dorpdown-layer").children(".item-sub").eq(index).show();



                })

                $(".dd-inner").hover(function() { //整个导航菜单悬浮，是否显示二级导航到出厂

                    $("#index_menus_sub").show();

                }, function() {

                    $("#index_menus_sub").hide();

                    $('.item').removeClass("hover");

                })

                $("#index_menus_sub").children(".item-sub").hover(function() { //二级导航悬浮

                    var index = $(this).index();

                    $(".dd-inner").children(".item").eq(index).addClass("hover");

                    $("#index_menus_sub").show();

                }, function() {

                    $("#index_menus_sub").hide();

                    $(".dd-inner").children(".item").removeClass("hover");

                })

            })

 

  </script> <?php }?>
</div>
